package com.qf.utils;

/*
杨威
2021/9/15
22:44
*/
public class Page {
    //1页标
    private Integer pageIndex;
    //2页容量
    private Integer pageSize;
    //3起始行
    private Integer startRow;
    //4数据条数
    private Long totalCount;
    //5总页数
    private Long totalPage;

    public Page() {
    }

//    public Page(Integer pageIndex) {
//        this.pageIndex = pageIndex;
//        pageSize=2;
//        startRow=(pageIndex-1)*pageSize;
//    }

    public void setPageIndex(Integer pageIndex) {
        this.pageIndex = pageIndex;
        pageSize=2;
        startRow=(pageIndex-1)*pageSize;
    }

    public void setTotalCount(Long totalCount) {
        this.totalCount = totalCount;
        totalPage=totalCount%pageSize==0?totalCount/pageSize:totalCount/pageSize+1;
    }

    public Integer getPageIndex() {
        return pageIndex;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public Integer getStartRow() {
        return startRow;
    }

    public Long getTotalCount() {
        return totalCount;
    }

    public Long getTotalPage() {
        return totalPage;
    }
}
